package IO.高效字符流;

import java.io.*;
import java.util.ArrayList;

/**
 * BufferedReader ->readLine()     BufferedWriter -> newLine();
 */
public class 高效字符流 {
    public static void main(String[] args) throws IOException {
        FileReader fr = new FileReader("D:/IOFile/test/word.txt");
        FileWriter fw = new FileWriter("D:/IOFile/test/copy.txt");
        ArrayList<String> list = new ArrayList<>();

        BufferedReader br = new BufferedReader(fr);
        BufferedWriter bw = new BufferedWriter(fw);
        String ch = null;
        while(((ch = br.readLine()) != null)){
            list.add(ch);
        }
        for(String s : list){
            bw.write(s);
            bw.newLine();
            bw.flush();
        }
        bw.close();
        br.close();
    }
}
